package net.canang.codegen.engine.domain;

import org.apache.velocity.util.StringUtils;

/**
 * todo: comment
 */
public class ObjectProperty extends Property {

    private Model innerModel;
    private String refType;

    public ObjectProperty(Model model, Model innerModel) {
        super(model);
        this.innerModel = innerModel;
        this.setName(innerModel.getName());
        this.setJavaName(StringUtils.firstLetterCaps(innerModel.getName()));
        this.setPluralJavaName(StringUtils.firstLetterCaps(innerModel.getName() + "s")); // if not end with y
        this.setType(innerModel.getName());
        this.setJavaType(StringUtils.firstLetterCaps(innerModel.getName()));
    }

    public Model getInnerModel() {
        return innerModel;
    }

    public void setInnerModel(Model innerModel) {
        this.innerModel = innerModel;
    }

    public String getRefType() {
        return refType;
    }

    public void setRefType(String refType) {
        this.refType = refType;
    }
}